package com.manager.model;

import lombok.Data;

import java.time.LocalDateTime;

@Data
public class FileEntity {
    private Long id;
    private String name;
    private String type; // FILE or FOLDER
    private Long parentId;
    private String content; // 仅对文件有效
    private LocalDateTime createTime;
    private LocalDateTime updateTime;

    // Constructors
    public FileEntity() {
    }

    public FileEntity(String name, String type, Long parentId, String content) {
        this.name = name;
        this.type = type;
        this.parentId = parentId;
        this.content = content;
        this.createTime = LocalDateTime.now();
        this.updateTime = LocalDateTime.now();
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
}
